package com.lee;

import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisConnectionFactory {
    private  static final JedisPool jedisPool;

    static {
        JedisPoolConfig config = new JedisPoolConfig();
        config.setMaxTotal(10);
        config.setMaxIdle(10);
        config.setMinIdle(8);
        config.setMaxWaitMillis(1000);
        jedisPool = new JedisPool(config, "221.131.137.220", 8002,1000,"157242");


    }
    public static Jedis getJedis(){
        return jedisPool.getResource();
    }
}
